<template>
  <a-button type="primary" @click="hanldeLogin">login</a-button>
  <p>
    <pre>
      {{ templateById2 }}
    </pre>
  </p>
</template>

<script lang="ts" setup>
import { useRouter } from 'vue-router'
import { useUserStore, useTemplatesStore } from '@/stores';

const { login } = useUserStore()
const { templateById2 } = useTemplatesStore()
const router = useRouter()

const hanldeLogin = () => {
  login('devin')
  router.push('/')
}
</script>

<style lang="less" scoped></style>